package test;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class 集合去重 {

    public List<String> removeRe(List<String> param) {
        if(param.size() <=0) {
            return param;
        }
        Map<String,Integer> map = new HashMap<>();
        List<String> result = new ArrayList<>();
        for (int i = 0; i < param.size(); i++) {
            char[] chars = param.get(i).toCharArray();
            StringBuilder stringBuilder =  new StringBuilder();
            for (int j = 0; j < chars.length; j++) {
                if(chars[j] >=0 && chars[j] <=9) {
                    stringBuilder.append(chars[j]);
                }
            }

            if(!map.containsKey(stringBuilder.toString())) {
                result.add(param.get(i));
                map.put(stringBuilder.toString(),i);
            }
        }
        return result;
    }

    public static void main(String[] args) {

    }
}
